<template>
  <div id="app">
    <router-view/>
  </div>
</template>

<script>
import $store from '@/store/index'

export default {
  name: "app",
  created() {
    // //在页面加载时将sessionStorage里的信息保存到vuex里
    // let role = sessionStorage.getItem("role") ? sessionStorage.getItem("role") : ''
    // if (role) {
    //   $store.replaceState(Object.assign({}, $store.state, JSON.parse(role)))
    // }
    //
    // //在页面刷新时将vuex里的信息保存到sessionStorage里
    // window.addEventListener("beforeunload", () => {
    //   if ($store.state.userInfo) {
    //     sessionStorage.setItem('role', JSON.stringify($store.state))
    //   }
    // })

  }
}
</script>

<style lang="less">
body {
  background: #F3F4F5;
  font-family: PingFang SC-Regular, PingFang SC;
}

* {
  padding: 0;
  margin: 0;
  box-sizing: border-box;
}

body, ul, li, h1, h2, h3, h4, h5, h6, p, form, dl, dt, dd, img, ::after, ::before {
  margin: 0;
  padding: 0;
  font-weight: normal;
}

ul, ol, li {
  list-style: none;
}

img {
  border: 0 none;
  max-width: 100%;
}

a {
  text-decoration: none;
  color: #000;
}

input, textarea, button {
  outline: 0 none;
  font-family: PingFang SC-Regular, PingFang SC;
}

::before,
::after {
  box-sizing: border-box;
}

.clearfix {
  zoom: 1;
}

.clearfix::after {
  content: '';
  display: table;
  height: 0;
  visibility: hidden;
  clear: both;
}
</style>
